package com.liumingtai.demo03.web.service;

import com.liumingtai.demo03.api.UploadService;
import com.liumingtai.demo03.web.utils.OSSUtil;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.InputStream;

/*
 * @desc 因为dubble不支持文件协议
 * 所以文件的上传 在哪个web需要就引用 一边
 * */
@Service
@Log4j2
public class UploadServiceImpl implements UploadService {

    @Autowired
    OSSUtil oSSUtil;

    @Override
    public String uploadImage(String fileName, InputStream is) {
//        log.info(StrUtil.format("InputStream is ===> {}", is));
        return oSSUtil.upload(fileName, is);
    }
}
